Skip to content

Matrix mult#49

Open
IgnatSergeev wants to merge 14 commits intomainfrom
matrix-mult
Open

Matrix mult#49
IgnatSergeev wants to merge 14 commits intomainfrom
matrix-mult

Conversation

@IgnatSergeev
Copy link
Owner

@IgnatSergeev IgnatSergeev commented Sep 21, 2023

Тесты проводились на Ryzen 5 3600 (6 ядер 12 потоков); ns - микросекунды;
повторить можно так: dotnet run --project MatrixMult.Benchmark -c Release

Method Size Mean Error StdDev Median
MultiThreaded 12 1,440.989 us 23.4870 us 21.9697 us 1,449.913 us
SingleThreaded 12 9.413 us 0.1780 us 0.1828 us 9.370 us
MultiThreaded 24 1,511.912 us 19.1225 us 17.8872 us 1,507.717 us
SingleThreaded 24 79.184 us 0.6364 us 0.5641 us 79.279 us
MultiThreaded 48 1,597.716 us 13.1979 us 11.6996 us 1,599.044 us
SingleThreaded 48 602.948 us 5.9217 us 5.2494 us 603.997 us
MultiThreaded 96 2,364.145 us 20.7434 us 17.3217 us 2,366.357 us
SingleThreaded 96 4,722.600 us 63.4006 us 59.3050 us 4,698.229 us
MultiThreaded 192 13,292.585 us 264.4914 us 293.9815 us 13,320.894 us
SingleThreaded 192 38,618.250 us 578.3345 us 512.6785 us 38,491.138 us
MultiThreaded 384 96,396.841 us 1,913.9742 us 5,108.7847 us 96,298.317 us
SingleThreaded 384 316,629.004 us 5,433.4920 us 4,816.6492 us 316,113.300 us
MultiThreaded 768 860,154.135 us 29,757.9547 us 87,742.0008 us 900,158.650 us
SingleThreaded 768 3,358,376.408 us 22,296.8597 us 18,618.8877 us 3,357,119.300 us
MultiThreaded 1536 7,340,287.229 us 106,025.8568 us 93,989.1604 us 7,336,820.750 us
SingleThreaded 1536 28,130,801.187 us 82,136.2770 us 76,830.3244 us 28,122,851.700 us

Copy link

@YuriUfimtsev YuriUfimtsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что-то есть, но до полноценной реализации по условию еще далеко

[Params(12, 24, 48, 96, 192, 384, 768, 1536)]
public int Size;
private Matrix _fst;
private Matrix _sec;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо, чтобы компилятор не ругался

{
foreach (var test in Tests)
{
yield return new TestCaseData(MatrixMultiplier.MultiThreadedMultiply, test);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

От предупреждений компилятора надо избавиться

/// <summary>
/// Matrix elements
/// </summary>
private readonly int[,] _elements;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private-поля принято располагать выше: https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1201.md.
Кстати, StyleCop стоит к сборкам подрубать, чтобы он сразу на несоответствия стандартам ругался

IgnatSergeev and others added 5 commits October 29, 2023 16:33
Co-authored-by: Yuri Ufimtsev <91129832+YuriUfimtsev@users.noreply.github.com>
Co-authored-by: Yuri Ufimtsev <91129832+YuriUfimtsev@users.noreply.github.com>
# Conflicts:
#	C#/forSpbu/MatrixMult.Benchmark/MatrixMultBenchmark.cs
Comment on lines +21 to +26
public int Width => this._elements.GetLength(1);

/// <summary>
/// Constructs empty matrix
/// </summary>
public Matrix()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всё-таки лучше как StyleCop советует: поля, конструкторы, свойства, методы

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants